<?php
namespace Admin\Controller;
use Think\Controller;
class DelInfoController extends Controller {
    public function delinfo(){
        
        isMyCookie();
        isLogin();
        
        $Info=D('Home/Info');
        
        
        //$field=$Info->getInfoField();
        
        $where["id"]=$_POST['id'];
        //var_dump($where);exit();
        //$data['checkstate']=1;
        //$count=$Info->count();
        //$Page=getMyPage($count,10);
        //$show=$Page->show();
       // $list=$Info->field($field)->order('edate desc')->limit($Page->firstRow.','.$Page->listRows)->select();
        
        //$this->assign('page',$show);
        //$this->assign('list',$list);
        
        //$this->display();
        if ($Info->where($where)->delete()>0){
            echo "删除成功";
        }else {
            echo "删除失败";
        }
    }
    
    public function delinfoAll(){
        
        isMyCookie();
        isLogin();
        
        $Info=D('Home/Info');
    
    
        //$field=$Info->getInfoField();
    
        $ids=$_POST['id'];
        $where["id"]=array('in',$ids);
        //var_dump($where);exit();
        //$data['checkstate']=1;
        //$count=$Info->count();
        //$Page=getMyPage($count,10);
        //$show=$Page->show();
        // $list=$Info->field($field)->order('edate desc')->limit($Page->firstRow.','.$Page->listRows)->select();
    
        //$this->assign('page',$show);
        //$this->assign('list',$list);
    
        //$this->display();
        if ($Info->where($where)->delete()>0){
            echo "删除成功";
        }else {
            echo "删除失败";
        }
    }
}